<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Page Title</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
  <script>
    var arr = [1, 2, 3, 4, 5, 7, 8, 9]

    var arr1 = arr.sort(function () {

      return Math.random() - 0.5

    })
    console.log(arr1);

    
    
  </script>
</body>

</html>